package org.example.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.bytebuddy.dynamic.loading.ClassReloadingStrategy;
import net.bytebuddy.dynamic.loading.InjectionClassLoader;
import org.springframework.boot.autoconfigure.web.ResourceProperties;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author wen'ge
 * @since 2021-02-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Role对象", description="")
@TableName(value = "role")//如果当前实体类的类名与表名相同（不区分大小写），那么这个注解可省略
public class Role extends Model<Role> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String name;

    //这个注解意思：在执行更新操作时，将会忽略对当前字段的  非空判断
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String sn;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
